package com.briup.day16;

/**
 * @author lining
 * @date 2024/1/28 11:05
 */
public class Test6 {
    public void method(String className){
        try {
            System.out.println("try..start");
            //写可能发生异常的代码
            Class.forName(className);
            System.out.println("try...end");
        }catch (ClassNotFoundException e){
            //处理异常的逻辑== JVM
            System.out.println("catch...start");
            e.printStackTrace();
            System.out.println("catch...end");
        }finally {
            //无论是否发生异常都会执行代码
            System.out.println("finally...");
        }
    }
    public static void main(String[] args) {
        Test6 t = new Test6();
        t.method("com.briup.day16.Test6");
    }
}
